package com.nine.pesys.model.entity;

import javax.persistence.*;
import java.io.Serializable;

/**
 * 场地动态信息
 * Created by L先森 on 2014/12/20.
 */
@Entity
@Table(name = "tb_fileInformation")
public class FileInformation implements Serializable {
    private Long id;
    private Float cost;
    private String lifeTime;
    //    是否已过期
    private Boolean isDate;
    private Boolean isReturn;
    private User user;
    private Game game;
    private SportFieldDetail sportFieldDetail;

    @Id
    @Column(name = "id",length = 10)
    @GeneratedValue(strategy = GenerationType.AUTO)
    public Long getId() {
        return id;
    }

    public void setId(Long id) {
        this.id = id;
    }

    @Column
    public String getLifeTime() {
        return lifeTime;
    }

    public void setLifeTime(String lifeTime) {
        this.lifeTime = lifeTime;
    }

    @Column
    public Float getCost() {
        return cost;
    }

    public void setCost(Float cost) {
        this.cost = cost;
    }

    @Column
    public Boolean getIsReturn() {
        return isReturn;
    }

    public void setIsReturn(Boolean isReturn) {
        this.isReturn = isReturn;
    }

    @Column
    public Boolean getIsDate() {
        return isDate;
    }

    public void setIsDate(Boolean isDate) {
        this.isDate = isDate;
    }


    @ManyToOne(targetEntity = User.class,cascade = CascadeType.MERGE)
    @JoinColumn(name = "userId")
    public User getUser() {
        return user;
    }

    public void setUser(User user) {
        this.user = user;
    }

    @ManyToOne(targetEntity = SportFieldDetail.class,cascade = CascadeType.MERGE)
    @JoinColumn(name = "sportFieldDetailId")
    public SportFieldDetail getSportFieldDetail() {
        return sportFieldDetail;
    }

    public void setSportFieldDetail(SportFieldDetail sportFieldDetail) {
        this.sportFieldDetail = sportFieldDetail;
    }

    @ManyToOne(targetEntity = Game.class,cascade = CascadeType.MERGE)
    @JoinColumn(name = "gameId")
    public Game getGame() {
        return game;
    }

    public void setGame(Game game) {
        this.game = game;
    }
}
